/* Copyright 2023 The TensorFlow Authors. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
@use '@angular/material' as mat;
@use '@angular/material' as matm2;
@use '@angular/material' as matm2var;
@import 'tensorboard/webapp/theme/tb_theme';

$_accent: map-get(matm2.get-color-config($tb-theme), accent);

:host ::ng-deep .mat-tab-label {
  min-width: 0;
  padding: 0 30px;
}

.editor-controls {
  // controls should fill the full height except for the height of the footer.
  height: calc(100% - 45px);
}

.tab-group {
  // Override static position so this object is not seen in front of the
  // settings panel.
  position: relative;
  z-index: 0;
  height: 100%;
}

.header-list-item {
  padding: 3px;
  height: 24px;
}

.highlighted {
  background-color: matm2.get-color-from-palette(matm2var.$grey-palette, 200);
}

.highlight-bottom {
  border-bottom: 2px solid matm2.get-color-from-palette($_accent);
}

.highlight-top {
  border-top: 2px solid matm2.get-color-from-palette($_accent);
}

.footer {
  display: flex;
  position: absolute;
  left: 0;
  bottom: 0;
  box-sizing: border-box;
  width: 100%;
  align-items: center;
  justify-content: flex-end;
  padding: 4px;
  $border: matm2.get-color-from-palette($tb-foreground, border);
  border-top: 1px solid $border;

  @include tb-dark-theme {
    border-color: matm2.get-color-from-palette($tb-dark-foreground, border);
  }
}

.close-button {
  color: matm2.get-color-from-palette($tb-foreground, secondary-text);
  width: 84px;

  @include tb-dark-theme {
    color: matm2.get-color-from-palette($tb-dark-foreground, secondary-text);
  }
}

// Make the mat-tab-body-wrapper fill the height of its parent. When flex-grow
// is 0 this element tries to wrap its content but, mysteriously it does so
// incorrectly. This works around that by making the element fill the full area
// allowed for the tab content. Then the child element can correctly decide when
// a scroll bar is needed. This class is added to a div internal to the
// mat-tab-group.
::ng-deep .mat-mdc-tab-body-wrapper {
  flex: 1;
}
